﻿using System;
using System.ServiceModel;
using Bll;
using System.ServiceModel.Description;

namespace BllHost {
 
    /// <summary>
    /// The WCF self hosting class
    /// </summary>
    class Program {
    
        /// <summary>
        /// Starts the self hosting and close
        /// when the user press a key
        /// </summary>
        /// <param name="args">The argument parameters</param>
        static void Main(string[] args) {
            ServiceHost host = new ServiceHost(typeof(BllLessonService));
            ServiceHost host2 = new ServiceHost(typeof(BllBookingService));
            host.Open();
            host2.Open();
            Console.WriteLine("The BllLesson is Running with the following endpoints:");
            foreach(ServiceEndpoint se in host.Description.Endpoints)
                Console.WriteLine(se.Address.ToString());
            Console.WriteLine("__________________________");
            Console.WriteLine("The BllBooking is Running with the following endpoints:");
            foreach(ServiceEndpoint se in host2.Description.Endpoints)
                Console.WriteLine(se.Address.ToString());
            Console.ReadLine();
            host.Close();
            host2.Close();
        }
    }
}